package domain;

/**
 * domain实体
 * 主要作用：
 *  和数据库表一一对应
 */
public class User {
    private int id;//用户唯一识别的id
    private String username ;//用户名
    private String password ;//密码
    private String tel ;//手机号
    private String email;//电子邮箱
    private String sex;//性别
    private String position;//职位
    private String realname;//真实姓名
    private String unit;//单位
    private Role role;//角色
    private Integer state; //状态

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public User() {
    }

    public User(String username, String password, String tel, String email, String sex, String position, String realName, String unit, Role role) {
        this.username = username;
        this.password = password;
        this.tel = tel;
        this.email = email;
        this.sex = sex;
        this.position = position;
        this.realname = realName;
        this.unit = unit;
        this.role = role;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getRealName() {
        return realname;
    }

    public void setRealName(String realName) {
        this.realname = realName;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", tel='" + tel + '\'' +
                ", email='" + email + '\'' +
                ", sex='" + sex + '\'' +
                ", position='" + position + '\'' +
                ", realname='" + realname + '\'' +
                ", unit='" + unit + '\'' +
                ", role=" + role +
                ", state=" + state +
                '}';
    }
}
